package visitors;
import arbore.*;

public class PostordineVisitor extends NodAbstract{
	
	public void visit (Frunza n)
	{
		System.out.println(n.toString());;
	}
	
	public void visit (Nod n)
	{
		visit(n.getNodS());
		visit(n.getNodD());
		System.out.println(n.toString());
	}
	
	public void visit (NodAbstract n)
	{
		if (n instanceof Nod)
			visit ((Nod)n);
		else if (n instanceof Frunza)
			visit ((Frunza)n);
	}

	@Override
	public void acceptVisitor(Visitor v) {
		// TODO Auto-generated method stub
		
	}
}
